import request from "@/utils/request.js";

// 登录
export const login = (data) => {
  return request({
    url: "/mini/loginMini",
    data,
    method: "GET",
  });
};

// 扫码登录
export const scanLogin = (data) => {
  return request({
    url: "/mini/login",
    data,
    method: "GET",
  });
};

// 获取用户信息
export const getUserInfo = (data) => {
  return request({
    url: "/mini/userInfo",
    method: "GET",
    data,
  });
};

// 获取短信验证码
export const getSmsCode = (data) => {
  return request({
    url: "/mini/sms",
    method: "GET",
    data,
  });
};

// 修改用户信息
export const updateUserInfo = (data) => {
  return request({
    url: "/mini/updateUserInfo?isApp=true",
    method: "post",
    data,
  });
};

export const proxy = (data) => {
  return request({
    url: "/home/getConfigByKeys?keys=" + data,
    method: "GET",
  });
};

// 绑定微信
export const bandWx = (data) => {
  return request({
    url: "/user/bindWx",
    method: "get",
    data,
  });
};

// 绑定手机
export const bandTel = (data) => {
  return request({
    url: "/user/bindPhone",
    method: "get",
    data,
  });
};

// 清零
export const zero = (data) => {
  return request({
    url: "/home/zero",
    method: "get",
    data,
  });
};

// vip
export const postVip = (data) => {
  return request({
    url: "/user/payVip?isApp=true",
    method: "POST",
    data,
  });
};

// vip
export const getVipImg = (data) => {
  return request({
    url: "/home/getVipImg",
    method: "get",
  });
};

// 删除圈子
export const delCircle = (data) => {
  return request({
    url: "/home/delCircle",
    method: "GET",
    data,
  });
};

// 行业列表
export const getIndustryList = () => {
  return request({
    url: "/home/industry",
    method: "GET",
  });
};

// 行业列表
export const fillCircle = (data) => {
  return request({
    url: "/home/fillCircle",
    method: "GET",
    data,
  });
};

// 提交动态表单
export const addMember = (data) => {
  return request({
    url: "/home/addMember?isApp=true",
    method: "POST",
    data,
  });
};

// 猜你喜欢列表
export const getLikeList = (data) => {
  return request({
    url: "/home/random",
    method: "GET",
    data,
  });
};

// 创建圈子
export const createCircle = (data) => {
  return request({
    url: "/home/circle?isApp=true",
    method: "POST",
    data,
  });
};

// 新增或修改购买手机号配置
export const circlePhoneConfig = (data) => {
  return request({
    url: "/home/savePhoneConf",
    method: "POST",
    data,
  });
};

export const getPhoneConfig = (data) => {
  return request({
    url: "/home/findByPhoneConfList",
    method: "GET",
    data,
  });
};

// 搜索
export const searchData = (data) => {
  return request({
    url: "/home/searchCircle",
    method: "GET",
    data,
  });
};

// 清除搜索历史
export const clearHistory = (data) => {
  return request({
    url: "/home/delHistory",
    method: "GET",
    data,
  });
};

// 搜索历史
export const getHistoryList = (data) => {
  return request({
    url: "/home/history",
    method: "GET",
    data,
  });
};

// 圈子详情
export const circleInfo = (data) => {
  return request({
    url: "/home/circleInfo",
    method: "GET",
    data,
  });
};

// 圈子详情
export const circleBaseInfo = (data) => {
  return request({
    url: "/home/circleBaseInfo",
    method: "GET",
    data,
  });
};

// 加入圈子
export const addCircle = (data) => {
  return request({
    url: "/home/join",
    method: "GET",
    data,
  });
};

// 热门置顶
export const hotTop = (data) => {
  return request({
    url: "/home/trendsPage",
    method: "GET",
    data,
  });
};

// banner
export const banner = (data) => {
  return request({
    url: "/home/banner",
    method: "GET",
    data,
  });
};

// 动态详情
export const dynamicDetail = (data) => {
  return request({
    url: "/home/trendsInfo",
    method: "GET",
    data,
  });
};

// 圈子动态置顶
export const trends = (data) => {
  return request({
    url: "/home/trends?isApp=true",
    method: "POST",
    data,
  });
};

// 评论
export const postComment = (data) => {
  return request({
    url: "/home/comment?isApp=true",
    method: "POST",
    data,
  });
};

// 搜索历史
export const postMerchant = (data) => {
  return request({
    url: "/user/merchant?isApp=true",
    method: "POST",
    data,
  });
};

// 广播给群成员
export const broadcast = (data) => {
  return request({
    url: "/home/send",
    method: "GET",
    data,
  });
};

// 点赞
export const star = (data) => {
  return request({
    url: "/home/like?isApp=true",
    method: "POST",
    data,
  });
};

// 删除评论
export const deleteCommentData = (data) => {
  return request({
    url: "/home/delComment?id=" + data,
    method: "DELETE",
  });
};

// 聊天
export const postChat = (data) => {
  return request({
    url: "/home/chat?isApp=true",
    method: "POST",
    data,
  });
};

// 聊天记录
export const chatPage = (data) => {
  return request({
    url: "/home/chatPage",
    method: "get",
    data,
  });
};

// 发布供需
export const submitForSale = (data) => {
  return request({
    url: "/home/article?isApp=true",
    method: "POST",
    data,
  });
};

// 关联圈子列表
export const myCircle = (data) => {
  return request({
    url: "/home/myCircle",
    method: "GET",
    data,
  });
};

// 删除供需
export const deleteForSale = (data) => {
  return request({
    url: "/home/delTrends?id=" + data,
    method: "DELETE",
  });
};

// 圈子展示手机号
export const showTel = (data) => {
  return request({
    url: "/home/show?isApp=true",
    method: "POST",
    data,
  });
};

// 购买
export const buyHomeShow = (data) => {
  return request({
    url: "/home/buyHomeShow",
    method: "GET",
    data,
  });
};

// 我的成员信息
export const myProson = (data) => {
  return request({
    url: "/home/my",
    method: "GET",
    data,
  });
};

// 置顶
export const overhead = (data) => {
  return request({
    url: "/home/overhead",
    method: "GET",
    data,
  });
};

// 上传图片
export const postUploading = (data) => {
  return request({
    url: "/prod-api/common/upload",
    method: "POST",
    data,
  });
};

// 圈子公告
export const notice = (data) => {
  return request({
    url: "/home/notice",
    method: "GET",
    data,
  });
};

// 地区列表
export const getUserArea = (data) => {
  return request({
    url: "/user/area",
    method: "GET",
    data,
  });
};

// 好友列表
export const getFriendList = (data) => {
  return request({
    url: "/home/friendList",
    method: "GET",
    data,
  });
};

// 账单钱包
export const getBillPage = (data) => {
  return request({
    url: "/user/billPage",
    method: "GET",
    data,
  });
};

// 商户号列表
export const getMerchantPage = (data) => {
  return request({
    url: "/user/findByUserIdList",
    method: "GET",
    data,
  });
};

// 商户号列表
export const getFriendPage = (data) => {
  return request({
    url: "/user/friendPage",
    method: "GET",
    data,
  });
};

// 同意好友申请
export const getApplyFriendPage = (data) => {
  return request({
    url: "/user/apply?isApp=true",
    method: "POST",
    data,
  });
};

// 通讯录助手
export const concatList = (data) => {
  return request({
    url: "/user/memberMessage?isApp=true",
    method: "POST",
    data,
  });
};

// 查询更新商户签约申请
export const updateMerchant = (data) => {
  return request({
    url: "/user/updateMerchant",
    method: "GET",
    data,
  });
};

// 系统消息
export const getSystemMessage = (data) => {
  return request({
    url: "/user/list",
    method: "GET",
    data,
  });
};

// 退出圈子
export const quit = (data) => {
  return request({
    url: "/home/quit",
    method: "GET",
    data,
  });
};

// 系统消息详情
export const getNoticeId = (data) => {
  return request({
    url: "/user/" + data,
    method: "GET",
  });
};

// 获取填写项
export const getWriteFillList = (data) => {
  return request({
    url: "/home/type" + data,
    method: "GET",
  });
};

// 创建圈子
export const getWriteCircle = (data) => {
  return request({
    url: "/home/circle?isApp=true",
    method: "POST",
    data,
  });
};

// 圈子列表
export const getTrendsPage = (data) => {
  return request({
    url: "/home/trendsPage",
    method: "GET",
    data,
  });
};

// 发起圈子列表
export const getCirclePage = (data) => {
  return request({
    url: "/home/circlePage",
    method: "GET",
    data,
  });
};

// 圈子详情
export const getCircleDesk = (data) => {
  return request({
    url: "/home/circleInfo",
    method: "GET",
    data,
  });
};

// 举报
export const report = (data) => {
  return request({
    url: "/home/report?isApp=true",
    method: "POST",
    data,
  });
};

// 动态更多
export const getMessagePage = (data) => {
  return request({
    url: "/home/messagePage",
    method: "GET",
    data,
  });
};

// 动态
export const getMessage = (data) => {
  return request({
    url: "/home/message",
    method: "GET",
    data,
  });
};

// 精华
export const best = (data) => {
  return request({
    url: "/home/best",
    method: "GET",
    data,
  });
};

// 成员列表分页
export const getMemberPage = (data) => {
  return request({
    url: "/home/memberPage",
    method: "GET",
    data,
  });
};

// 付费进群
export const PostJoinRule = (data) => {
  return request({
    url: "/home/joinRule?isApp=true",
    method: "POST",
    data,
  });
};

// 付费进群
export const PostJoinList = (data) => {
  return request({
    url: "/home/joinList?isApp=true",
    method: "POST",
    data,
  });
};

// 设置-取消管理员设置
export const setAdmin = (data) => {
  return request({
    url: "/home/admin",
    method: "GET",
    data,
  });
};

// 管理员权限设置
export const setPower = (data) => {
  return request({
    url: "/home/member?isApp=true",
    method: "POST",
    data,
  });
};

// 管理员权限设置2
export const power = (data) => {
  return request({
    url: "/home/power?isApp=true",
    method: "POST",
    data,
  });
};

// 成员详情表
export const getMemberInfo = (data) => {
  return request({
    url: "/home/memberInfo",
    method: "GET",
    data,
  });
};

// 成员详情表
export const getRule = (data) => {
  return request({
    url: "/home/rule",
    method: "GET",
    data,
  });
};

// 购买手机号
export const buyShow = (data) => {
  return request({
    url: "/home/buyShow",
    method: "GET",
    data,
  });
};

// 发布供需
export const postTrends = (data) => {
  return request({
    url: "/home/trends?isApp=true",
    method: "POST",
    data,
  });
};

// 发布供需
export const addFriend = (data) => {
  return request({
    url: "/home/addFriend?isApp=true",
    method: "POST",
    data,
  });
};

// 删除并踢出成员
export const delTrendsAndMember = (data) => {
  return request({
    url: "/home/delTrendsAndMember",
    method: "GET",
    data,
  });
};

// 删除成员
export const deletePerson = (data) => {
  return request({
    url: "/home/delMemeber",
    method: "GET",
    data,
  });
};

// 参与的圈子
export const joinCirclePage = (data) => {
  return request({
    url: "/home/joinCirclePage",
    method: "GET",
    data,
  });
};

// 参与的圈子
export const addMerchant = (data) => {
  return request({
    url: "/home/merchant",
    method: "GET",
    data,
  });
};

// 参与的圈子
export const getCircleList = (data) => {
  return request({
    url: "/home/getCircleList",
    method: "GET",
    data,
  });
};

// 参与的圈子
export const MyTrendsPage = (data) => {
  return request({
    url: "/home/myTrendsPage",
    method: "GET",
    data,
  });
};

// 签约
export const getSignUrl = (data) => {
  return request({
    url: "/user/getSignUrl",
    method: "GET",
    data,
  });
};

// 签约
export const myChat = (data) => {
  return request({
    url: "/home/myChatList",
    method: "GET",
    data,
  });
};

// 删除好友
export const deleteApply = (data) => {
  return request({
    url: "/user/deleteApply/" + data?.id,
    method: "delete",
  });
};

// 删除帖子
export const deleteMyTrends = (data, type) => {
  return request({
    url: "/home/deleteMyTrends/" + data,
    method: "delete",
  });
};

// 热度计算
export const contact = (data) => {
  return request({
    url: "/home/contact",
    method: "get",
    data,
  });
};

// 获取当前用户拥有的圈子的权限
export const getPowerInfo = (data) => {
  return request({
    url: "/home/getPowerInfo",
    method: "get",
    data,
  });
};

// 查询指定用户对应圈子的权限
export const getPowerList = (data) => {
  return request({
    url: "/home/getPowerList",
    method: "get",
    data,
  });
};

// 热度计算
export const applyments = (data) => {
  return request({
    url: "/user/applyments",
    method: "POST",
    data,
  });
};

// 热度计算
export const userDetails = (data) => {
  return request({
    url: "/user/details/" + data,
    method: "get",
  });
};

// 热度计算
export const h5Pay = (data) => {
  return request({
    url: "/user/h5pay?type=" + data.type,
    method: "get",
    data,
  });
};

// 热度计算
export const miniPay = (data) => {
  return request({
    url: "/mini/pay",
    method: "POST",
    data,
  });
};

// 热度计算
export const getPayStat = (data) => {
  return request({
    url: "/home/getPayStat?circleId=" + data,
    method: "GET",
  });
};

// 圈子详情--我的海报
export const getPoster = (data) => {
  return request({
    url: "/home/qcCode?circleId=" + data,
    method: "GET",
  });
};

// 为管理员设置权限获取配置
export const getBaseAdminConfig = () => {
  return request({
    url: "/home/type/power_type",
    method: "GET",
  });
};

// 为管理员设置权限获取配置
export const setUpPower = (data) => {
  return request({
    url: "/home/power",
    method: "POST",
    data,
  });
};

// 微信公众号支付 获取用户code 绑定openId
export const getOpenId = (data) => {
  return request({
    url: "/home/getOpenId",
    method: "GET",
    data,
  });
};

// 删除电话展示
export const deletePhone = (data) => {
  return request({
    url: "/home/deletePhonconf",
    method: "GET",
    data,
  });
};
